
export default function install(Vue) {
  Vue.filter('timeFilter', (value) => {
    let d = new Date(value)
    let ndate = (d.getDate() < 10 ? '0' : '') + d.getDate()
    let month = (d.getMonth() + 1 < 10 ? '0' : '') + (d.getMonth() + 1)
    let hours = (d.getHours() < 10 ? '0' : '') + d.getHours()
    let minutes = (d.getMinutes() < 10 ? '0' : '') + d.getMinutes()
    let checkDate = d.getFullYear() + '-' + month + '-' + ndate + '      ' + hours + ':' + minutes
    return checkDate
  })
  Vue.filter('thousandFilter', (value) => {
    let intPart = Number(value / 100).toFixed(2) // 获取整数部分
    let intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
    return intPartFormat
    // if (typeof (value) === 'number') return (value).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
  })
}